/*
 Navicat Premium Data Transfer

 Source Server         : 云-120.24.33.70
 Source Server Type    : MySQL
 Source Server Version : 80017
 Source Host           : 120.24.33.70
 Source Database       : admin

 Target Server Type    : MySQL
 Target Server Version : 80017
 File Encoding         : utf-8

 Date: 12/30/2020 15:10:59 PM
*/

SET NAMES utf8;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
--  Table structure for `tb_sys_resource`
-- ----------------------------
DROP TABLE IF EXISTS `tb_sys_resource`;
CREATE TABLE `tb_sys_resource` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
  `name` varchar(40) NOT NULL DEFAULT '' COMMENT '资源名称',
  `parent_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '父菜单',
  `level` smallint(2) NOT NULL DEFAULT '0' COMMENT '资源层级',
  `parent_ids` varchar(2000) NOT NULL DEFAULT '' COMMENT '父资源联集',
  `sort` smallint(6) NOT NULL DEFAULT '0' COMMENT '排序',
  `href` varchar(1000) NOT NULL DEFAULT '' COMMENT '链接地址',
  `target` varchar(20) NOT NULL DEFAULT '' COMMENT '打开方式',
  `icon` varchar(100) NOT NULL DEFAULT '' COMMENT '图标',
  `color` varchar(255) NOT NULL DEFAULT '' COMMENT '背景颜色 #ffffff',
  `type` tinyint(2) NOT NULL DEFAULT '0' COMMENT '类型 1:菜单 2:按钮',
  `permission` varchar(200) NOT NULL DEFAULT '' COMMENT '权限标识',
  `create_by` varchar(64) NOT NULL DEFAULT '' COMMENT '创建者',
  `update_by` varchar(64) DEFAULT NULL COMMENT '更新者',
  `remarks` varchar(255) NOT NULL DEFAULT '' COMMENT '备注信息',
  `is_deleted` tinyint(4) NOT NULL DEFAULT '0' COMMENT '状态 0:未删除 1:已删除',
  `status` tinyint(4) NOT NULL DEFAULT '1' COMMENT '状态 0:禁用，1:启用',
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=43 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='系统菜单';

-- ----------------------------
--  Records of `tb_sys_resource`
-- ----------------------------
BEGIN;
INSERT INTO `tb_sys_resource` VALUES ('38', '系统设置', '0', '1', '38,', '0', '/', '', '', '', '1', '', 'admin', null, '', '0', '1', '2020-12-30 14:35:35', '2020-12-30 14:35:33'), ('39', '用户管理', '38', '2', '38,39,', '0', '/sys/users', '', '', '', '1', '', 'admin', null, '', '0', '1', '2020-12-30 14:36:03', '2020-12-30 14:36:00'), ('40', '菜单管理', '38', '2', '38,40,', '0', '/sys/resource', '', '', '', '1', '', 'admin', null, '', '0', '1', '2020-12-30 14:36:52', '2020-12-30 14:36:51'), ('41', '角色管理', '38', '2', '38,41,', '0', '/sys/roles', '', '', '', '1', '', 'admin', null, '', '0', '1', '2020-12-30 14:37:21', '2020-12-30 14:37:18'), ('42', '个人中心', '38', '2', '38,42,', '0', '/sys/person', '', '', '', '1', '', 'admin', null, '', '0', '1', '2020-12-30 14:37:53', '2020-12-30 14:37:51');
COMMIT;

-- ----------------------------
--  Table structure for `tb_sys_role`
-- ----------------------------
DROP TABLE IF EXISTS `tb_sys_role`;
CREATE TABLE `tb_sys_role` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
  `code` varchar(32) DEFAULT '' COMMENT '角色编码',
  `name` varchar(40) NOT NULL DEFAULT '' COMMENT '角色名称',
  `remarks` varchar(255) NOT NULL DEFAULT '' COMMENT '备注信息',
  `sort` smallint(6) NOT NULL DEFAULT '0' COMMENT '排序',
  `create_by` varchar(64) NOT NULL DEFAULT '' COMMENT '创建者',
  `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_by` varchar(64) DEFAULT NULL COMMENT '更新者',
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `is_deleted` tinyint(4) NOT NULL DEFAULT '0' COMMENT '状态 0:未删除 1:已删除',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='系统角色';

-- ----------------------------
--  Records of `tb_sys_role`
-- ----------------------------
BEGIN;
INSERT INTO `tb_sys_role` VALUES ('1', '', '超级管理员', '', '0', '', '1980-01-01 00:00:00', null, '2020-12-30 14:11:43', '0'), ('20', '', '00000', '', '0', '', '1980-01-01 00:00:00', null, '2020-12-08 15:53:17', '0'), ('21', '', '牛逼的角色', '', '0', '', '2020-12-10 10:25:36', null, '2020-12-10 10:25:36', '0'), ('22', '', '魔法师', '', '0', '', '2020-12-10 11:01:40', null, '2020-12-10 11:02:15', '0'), ('23', '', '模仿是微软', '', '0', '', '2020-12-10 11:02:28', null, '2020-12-10 11:02:28', '0');
COMMIT;

-- ----------------------------
--  Table structure for `tb_sys_role_resource`
-- ----------------------------
DROP TABLE IF EXISTS `tb_sys_role_resource`;
CREATE TABLE `tb_sys_role_resource` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
  `role_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '角色ID',
  `resource_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '资源ID',
  PRIMARY KEY (`id`),
  UNIQUE KEY `role_id` (`role_id`,`resource_id`)
) ENGINE=InnoDB AUTO_INCREMENT=60 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='系统角色-菜单';

-- ----------------------------
--  Records of `tb_sys_role_resource`
-- ----------------------------
BEGIN;
INSERT INTO `tb_sys_role_resource` VALUES ('55', '1', '38'), ('56', '1', '39'), ('57', '1', '40'), ('58', '1', '41'), ('59', '1', '42');
COMMIT;

-- ----------------------------
--  Table structure for `tb_sys_user`
-- ----------------------------
DROP TABLE IF EXISTS `tb_sys_user`;
CREATE TABLE `tb_sys_user` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
  `login_name` varchar(36) NOT NULL DEFAULT '' COMMENT '登录名',
  `nick_name` varchar(40) NOT NULL DEFAULT '' COMMENT '昵称',
  `icon` varchar(2000) NOT NULL DEFAULT '' COMMENT '头像',
  `password` varchar(40) NOT NULL DEFAULT '' COMMENT '密码',
  `salt` varchar(40) NOT NULL DEFAULT '' COMMENT '加密盐',
  `tel` varchar(11) NOT NULL DEFAULT '' COMMENT '手机号码',
  `email` varchar(200) NOT NULL DEFAULT '' COMMENT '邮箱地址',
  `locked` tinyint(2) NOT NULL DEFAULT '0' COMMENT '是否锁定',
  `enabled` tinyint(2) NOT NULL DEFAULT '1' COMMENT '0:禁用，1:开启',
  `remarks` varchar(255) NOT NULL DEFAULT '' COMMENT '备注信息',
  `create_by` varchar(64) NOT NULL DEFAULT '' COMMENT '创建者',
  `create_time` timestamp NOT NULL DEFAULT '1980-01-01 00:00:00' COMMENT '创建时间',
  `update_by` varchar(64) NOT NULL COMMENT '更新者',
  `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `is_deleted` tinyint(2) NOT NULL DEFAULT '0' COMMENT '状态 0:未删除 1:已删除',
  `phone` varchar(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='用户信息表';

-- ----------------------------
--  Records of `tb_sys_user`
-- ----------------------------
BEGIN;
INSERT INTO `tb_sys_user` VALUES ('1', 'admin', '雷布斯1', '', 'ce9043106f3adda50e59d2df0543c45b', 'ac9eab96b61c4fe690e47d689055746a', '13640218134', '1057386568@qq.com', '0', '1', '一个 bug 改一天', '', '1980-01-01 00:00:00', '', '2020-12-09 17:13:30', '0', null);
COMMIT;

-- ----------------------------
--  Table structure for `tb_sys_user_role`
-- ----------------------------
DROP TABLE IF EXISTS `tb_sys_user_role`;
CREATE TABLE `tb_sys_user_role` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
  `user_id` bigint(20) NOT NULL DEFAULT '0',
  `role_id` bigint(20) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_id` (`user_id`,`role_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='用户-角色表';

-- ----------------------------
--  Records of `tb_sys_user_role`
-- ----------------------------
BEGIN;
INSERT INTO `tb_sys_user_role` VALUES ('1', '1', '1');
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
